<!DOCTYPE html>
<html>
<head>
  <meta charset="UTF-8">
  <title>Document</title>
  <style>
    
  </style>
</head>
<body>
</body>
<script>

// 邮箱的验证正则
// var reg = /^[a-z\d]+(\.[a-z\d]+)*@([\da-z](-[\da-z])?)+(\.{1,2}[a-z]+)+$/;
// 数字字母1+ (.(字母数字)1+)0+ @ (数字字母1位 (-(数字字母))0或1)1+ (.1或2 字母1+)1+
// var str = "abc123.qwe234@d-12-fa-6a..a..b..c";
// var str = "abc123.qwe234@1a2fa6a..a..b..c";
// var str = "abc123.qwe234@d-2-fa-6a..a..b..c";
// var str = "abc123.qwe234@-a2-fa-6a..a..b..c";
// var str = "abc123.qwe_234@1-a2-fa-6a..a..b..c";
// console.log(reg.test(str));


// URL的验证正则
// var reg = /^(https?:\/\/)?([\da-z\.-]+)\.([a-z\.]{2,6})([\/\w \.-]*)*\/?$/;
// (http s0或1 ://)0或1 (数字字母.-)1+ . (字母.)2~6 ((斜杠数字字母下划线空格.-)0+)0+ /0或1
// var str = "https://123abc.-qwe345.abc.a/javascript/qian_feng/day-01/index.html";
// var str = "https://123abc.-345.abc.a/js/day-01/index.html";
// var str = "https://123abc.-345.abde_fgh&jiklc.a/js/day-01/index.html";
// console.log(reg.test(str));


// html标签的验证正则
// var reg = /^<([a-z]+)([^<]+)*(?:>(.*)<\/\1>|\s+\/>)$/;
// < (字母1+) (除了< 1+)0+ > 任意字符任意个 </ 重复第一个子串 >
// < (字母1+) (除了< 1+)0+ 空格1+ />
// var str = "<div title='这是title￥%…&'>标签内容</div>";
// var str = "<div title='这是title￥%…&' />";
// var str = "<div title='这是title￥%…&' >";
//   var str = "<div title='这是title￥%…&'>标签内容</span>";
// console.log(reg.test(str));

  
</script>
</html>